<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>erwiki</groupId>
	<artifactId>global_configuration</artifactId>
	<version>1.0.0</version>
	<packaging>pom</packaging>
	<name>Global building configuration</name>
	<description>Global building configuration.</description>

	<inceptionYear>2023</inceptionYear>
	<developers>
		<developer>
			<id>vfedorov</id>
			<name>Victor Fedorov</name>
			<email>fedorov.vk@yandex.ru</email>
			<url></url>
			<organization></organization>
			<organizationUrl></organizationUrl>
			<roles>
				<role>developer</role>
			</roles>
			<timezone>-3</timezone>
			<properties />
		</developer>
	</developers>
	<licenses>
		<!--
		<license>
			<name>Apache-2</name>
			<url>https://www.eclipse.org/legal/epl-v20.html</url>
			<distribution>package</distribution>
			<comments>A business-friendly OSS license</comments>
		</license>
		-->
		<license>
			<name>BSD</name> <!-- workaround -->
			<url>https://www.eclipse.org/legal/epl-v20.html</url>
			<distribution>package</distribution>
			<comments>A business-friendly OSS license</comments>
		</license>
	</licenses>

	<properties>
		<maven.compiler.source>17</maven.compiler.source>
		<maven.compiler.target>17</maven.compiler.target>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
		<tycho.version>4.0.4</tycho.version>
		<!-- definitions of resources plugin build -->
		<wro4j.version>1.10.1</wro4j.version>
		<minimize>false</minimize> <!-- wro4j compression -->
		<maven.resources.plugin.version>3.2.0</maven.resources.plugin.version>

		<!-- JSPwiki
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<jdk.version>1.8</jdk.version>
		<lucene.version>4.7.0</lucene.version>
		<selenium.version>2.42.0</selenium.version>
		<slf4j.version>1.7.12</slf4j.version>
		-->

		<!-- The build type, N for nighty builds, S for stable builds. S-builds will be signed. -->
		<!-- <buildType>N</buildType>
			<build>${maven.build.timestamp}</build> -->
	</properties>

	<prerequisites>
		<maven>3.0</maven>
	</prerequisites>

	<repositories>
		<repository>
			<id>platform-repo</id>
			<layout>p2</layout>
			<url>${platform-repo.url}</url>
		</repository>

		<repository>
			<id>rap-repo</id>
			<layout>p2</layout>
			<url>${rap-repo.url}</url>
		</repository>
		<repository>
			<id>rap-e4-repo</id>
			<layout>p2</layout>
			<url>${rap-e4-repo.url}</url>
		</repository>
		<repository>
			<id>apache-tools-repo</id>
			<layout>p2</layout>
			<url>${custom-repo01.url}</url>
		</repository>
		<repository>
			<id>custom-p2-repo</id>
			<layout>p2</layout>
			<url>${custom-repo02.url}</url>
		</repository>
		<repository>
			<id>additional-artifacts</id>
			<layout>p2</layout>
			<url>${custom-repo03.url}</url>
		</repository>
		<repository>
			<id>for-test-site</id>
			<layout>p2</layout>
			<url>${custom-repo04.url}</url>
		</repository>
<!--
-->
<!--
		<license-repo.url>file:/repo/License/p2_archive</license-repo.url>
		<rap-repo.url>file:/repo/RAP/rap-e4-3.9.0-R-20190612-1720</rap-repo.url>
		<repository>
			<id>rap-repo</id>
			<layout>p2</layout>
			<url>${rap-repo.url}</url>
		</repository>
		<jdbc-repo.url>file:/repo/CDO_reposes/JDBC_extension_repository</jdbc-repo.url>
		<repository>
			<id>jdbc-repo</id>
			<layout>p2</layout>
			<url>${jdbc-repo.url}</url>
		</repository>
-->
	</repositories>

	<build>
		<sourceDirectory>src</sourceDirectory>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-toolchains-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<toolchains>
						<!-- this project needs a JDK toolchain, version 17 -->
						<jdk>
							<version>17</version>
							<vendor>openjdk</vendor>
						</jdk>
					</toolchains>
				</configuration>
				<executions>
					<execution>
						<!-- the toolchain goal binds to the validate phase automatically -->
						<goals>
							<goal>toolchain</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- enable tycho build extension -->
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
			</plugin>

			<!-- Builds Java documenatation. -->
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.4.1</version>
				<configuration>
					<reportOutputDirectory>${env.JAVADOC}</reportOutputDirectory>
					<doclint>none</doclint>
					<quiet>true</quiet>
					<failOnError>false</failOnError>
				</configuration>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<!-- enable tycho build extension -->
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-maven-plugin</artifactId>
					<version>${tycho.version}</version>
					<extensions>true</extensions>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-compiler-plugin</artifactId>
					<version>${tycho.version}</version>
					<configuration>
						<encoding>UTF-8</encoding>
					</configuration>
				</plugin>

				<plugin>
					<!-- Restrict to environment to enable platform independent war-build -->
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>target-platform-configuration</artifactId>
					<version>${tycho.version}</version>
					<configuration>
						<executionEnvironment>JavaSE-17</executionEnvironment>
						<!-- :FVK: что это определяет?
						<target>
						<artifact>
						<groupId>fvk.data.server</groupId>
						<artifactId>target_platform</artifactId>
						<version>1.0.0-SNAPSHOT</version>
						</artifact>
						</target>
						-->
						<environments>
							<environment>
								<os>${target-os}</os>
								<ws>${target-ws}</ws>
								<arch>${target-arch}</arch>
							</environment>
						</environments>
					</configuration>
				</plugin>

				<!-- Configure qualifier replacement -->
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-packaging-plugin</artifactId>
					<version>${tycho.version}</version>
					<configuration>
						<format>yyyyMMdd-HHmm</format>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-p2-plugin</artifactId>
					<version>${tycho.version}</version>
					<configuration>
						<baselineRepositories>
							<repository>
								<url>${tycho-baseline-repo.url}</url>
							</repository>
						</baselineRepositories>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-source-plugin</artifactId>
					<version>${tycho.version}</version>
					<executions>
						<execution>
							<id>plugin-source</id>
							<goals>
								<goal>plugin-source</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-surefire-plugin</artifactId>
					<version>${tycho.version}</version>
				</plugin>

				<plugin>
					<groupId>ro.isdc.wro4j</groupId>
					<artifactId>wro4j-maven-plugin</artifactId>
					<version>${wro4j.version}</version>
					<configuration>
						<!--
						<targetGroups>all</targetGroups>
						<jsDestinationFolder>${project.build.directory}/generated-sources/wro/scripts</jsDestinationFolder>
						<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
						-->
						<contextFolder>${project.basedir}/main/context/</contextFolder>
						<extraConfigFile>${project.basedir}/main/config/wro/wro.properties</extraConfigFile>
						<minimize>${minimize}</minimize>
						<ignoreMissingResources>false</ignoreMissingResources>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>linux</id>
			<activation>
				<activeByDefault>true</activeByDefault>
				<os>
					<family>unix</family>
				</os>
			</activation>
			<properties>
				<rap-repo.url>file:${env.RAP_REPO}</rap-repo.url>
				<rap-e4-repo.url>file:${env.RAP_E4_REPO}</rap-e4-repo.url>
				<platform-repo.url>file:${env.PLATFORM_REPO}</platform-repo.url>
				<custom-repo01.url>file:${env.CUSTOM_REPO01}</custom-repo01.url>
				<custom-repo02.url>file:${env.CUSTOM_REPO02}</custom-repo02.url>
				<custom-repo03.url>file:${env.CUSTOM_REPO03}</custom-repo03.url>
				<custom-repo04.url>file:${env.CUSTOM_REPO04}</custom-repo04.url>
				<target-os>linux</target-os>
				<target-ws>gtk</target-ws>
				<target-arch>x86_64</target-arch>
				<tests-argLine>
 -Dorg.osgi.service.http.port=8088
 -Derwiki.users.database=/home/vfedorov/dev/dev_wikijsp/WS/data/users.json
 -Derwiki.groups.database=/home/vfedorov/dev/dev_wikijsp/WS/data/groups.json
 -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
 -Dstorage.cdo.port=2039
				</tests-argLine>
			</properties>
		</profile>

<!--
 -Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y
-->

		<profile>
			<id>windows</id>
			<activation>
				<activeByDefault>false</activeByDefault>
				<os>
					<family>windows</family>
				</os>
			</activation>
			<properties>
				<rap-repo.url>file:///${env.RAP_REPO}</rap-repo.url>
				<rap-e4-repo.url>file:///${env.RAP_E4_REPO}</rap-e4-repo.url>
				<platform-repo.url>file:///${env.PLATFORM_REPO}</platform-repo.url>
				<custom-repo01.url>file:///${env.CUSTOM_REPO01}</custom-repo01.url>
				<custom-repo02.url>file:///${env.CUSTOM_REPO02}</custom-repo02.url>
				<custom-repo03.url>file:///${env.CUSTOM_REPO03}</custom-repo03.url>
				<custom-repo04.url>file:///${env.CUSTOM_REPO04}</custom-repo04.url>
				<target-os>win32</target-os>
				<target-ws>win32</target-ws>
				<target-arch>x86_64</target-arch>
				<tests-argLine>
 -Dorg.osgi.service.http.port=8088
 -Derwiki.users.database=D:/devj/dev_wikijsp/WS/data/users.json
 -Derwiki.groups.database=D:/devj/dev_wikijsp/WS/data/groups.json
 -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
 -Dstorage.cdo.port=2039
				</tests-argLine>
			</properties>
			<build></build>
		</profile>
	</profiles>
</project>
